export {}
class Person{
    name:string='xx';
    getName():void{
        console.log(this.name);   
    }
}
let p1 = new Person();
p1.name ='xx'
p1.getName();

//定义存取器 属性的读取和赋值操作
class User{
    //myName:string 参数属性
    constructor(public myName:string){//构造函数
        //this.myName = myName
    }
    get name(){
        return this.myName
    }
    set name(value){//存取器
        this.myName = value
    }
}
let user = new User('zhufeng')
user.name = 'xiaogou'
console.log(user.name);
//readonly 
class Animal{
    public readonly name:string;
    constructor(name:string){
        this.name = name
    }
    changeName(name:string){
        this.name = name
    }
}

//public protected private

